FlatFileDataSource

Overview

This example shows how to create and use a flat file database with the EOF interface layer . Specifically, the application  implements a master-detail setup  (a to-many relationship between 2 entities)
 
The flat file database is in ./DATABASE. It contains 2 tables:
	1- The Product.table (the master table)
	2- The Item.table (the detail table)
A flat file table is a string "archive" of an NSArray of records. A record in the table is a property list   (key-value pairs archived in a string format; take a look at the files...)

Program Organization

The interesting Class is the TableDataSource. This data source reads a flat file table (such as Product.table or Item.table) and generates EOGeneric records that can be passed to an EOController.  The properties of these  EOGeneric records can be displayed and modified using the EOF interface layer. As usual, the controller and the associated UI can be rapidly prototyped using Interface Builder. If you drag a model into IB to create the controllers, their dataSource outlet needs to be unset (look at FlatFileDataSource.nib).  Only a few lines of codes are necessary to complete the setup. A TableDataSource must be instantiated and connected to the controller (see AppController.m). 

When an EOController creates new records, updates or deletes existing records, the  data source will update the table file to reflect these changes when asked to "-saveObjects"... You can use EOModeler to specify the entities in your flat file database  (watch out, there is no Adaptor! A little forgery is required) One major improvement would be to support flattened attribute. Look out for a forthcoming example!!! In the meantime, enjoy...

Usage
Note that you need to run your application inside your project directory, because by default, the DATABASE folder is located inside the project directory. Otherwise, you need to make the appropriate change to the default path name (See AppController.m, DATABASE definition).  
 
Valid for NEXTSTEP 3.2 Release installed with EOF Release 1.0